<template>
	<div id="he-plugin-standard"></div>
</template>

<script>
export default {
	name: "CWeather",
	props: {
		props: {
			type: Array,
			default: function() {
				return [
					{
						fields: [],
					},
				];
			},
		},
	},
	beforeMount() {
		window.WIDGET = {
			CONFIG: {
				layout: "1",
				width: "450",
				height: "150",
				background: "5",
				dataColor: "FFFFFF",
				borderRadius: "5",
				key: "1efff4db34084caaace547cc4b1e06d5",
			},
		};
		(function(d) {
			var c = d.createElement("link");
			c.rel = "stylesheet";
			c.href = "/weather/he-standard.css";
			var s = d.createElement("script");
			s.src = "/weather/he-standard.js";
			var sn = d.getElementsByTagName("script")[0];
			// console.log(sn)
			sn.parentNode.insertBefore(c, sn);
			sn.parentNode.insertBefore(s, sn);
		})(document);
		// ;(function (d) {
		// 	var s = d.createElement('script')
		// 	s.src =
		// 		'https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0'
		// 	var sn = d.getElementsByTagName('script')[0]

		// 	sn.parentNode.insertBefore(s, sn)
		// })(document)
	},
};
</script>
<style lang="scss" scoped></style>
